package com.agile.leetcode.spi.impl;

import com.mysql.jdbc.NonRegisteringDriver;

import java.sql.*;
import java.util.Properties;
import java.util.logging.Logger;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/3/25 10:23
 */
public class DriverImpl extends NonRegisteringDriver implements Driver {
    static {
        try {
            java.sql.DriverManager.registerDriver(new DriverImpl());
        } catch (SQLException ignored) {
        }
    }

    public DriverImpl() throws SQLException {
    }

    @Override
    public Connection connect(String url, Properties info) throws SQLException {
        System.out.println("DriverImpl连接了");
        return super.connect(url, info);
    }

    @Override
    public boolean acceptsURL(String url) throws SQLException {
        return false;
    }

    @Override
    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
        return new DriverPropertyInfo[0];
    }

    @Override
    public int getMajorVersion() {
        return 0;
    }

    @Override
    public int getMinorVersion() {
        return 0;
    }

    @Override
    public boolean jdbcCompliant() {
        return false;
    }

    @Override
    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return null;
    }
}
